{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b2147033",
   "metadata": {},
   "outputs": [],
   "source": [
    "from aplpy import FITSFigure, make_rgb_image, make_rgb_cube\n",
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "9be4a70f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# List all the bone names\n",
    "ListNames = ['Fil1', 'Fil2', 'Fil4', 'Fil5', 'Fil8', 'Fil10', 'G24', 'G47', 'G49', 'Snake']\n",
    "# Colors\n",
    "RedStr = '24'\n",
    "GreenStr = '8'\n",
    "BlueStr = '3'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "27bc1969",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current RGB cube: Fil1\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: Fil2\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: Fil4\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: Fil5\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: Fil8\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: Fil10\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: G24\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: G47\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: G49\n",
      "Colors: 24 um, 8 um, 3 um\n",
      "Current RGB cube: Snake\n",
      "Colors: 24 um, 8 um, 3 um\n"
     ]
    }
   ],
   "source": [
    "for Name in ListNames:\n",
    "    # Reference and Output directories for the bone\n",
    "    print('Current RGB cube: '+Name)\n",
    "    RefDir = 'Spitzer/'+Name+'/'\n",
    "    OutDir = 'Cubes/'\n",
    "    print('Colors: '+RedStr+' um, '+GreenStr+' um, '+BlueStr+' um')\n",
    "    # Associating Red, Green, and Blue to specific FITS files\n",
    "    Red= RefDir+Name+'_'+RedStr+'um.fits'\n",
    "    Green= RefDir+Name+'_'+GreenStr+'um.fits'\n",
    "    Blue= RefDir+Name+'_'+BlueStr+'um.fits'\n",
    "    # Creating the RGB cube\n",
    "    make_rgb_cube([Red,Green,Blue], OutDir+Name+'_RGB_cube_'+RedStr+'_'+GreenStr+'_'+BlueStr+'.fits', north=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "0472f242",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current RGB image: Fil1\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  1.527e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  4.024e+02 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  2.146e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.193e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  1.523e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  4.111e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: Fil2\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  1.833e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  9.511e+02 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  3.038e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  3.565e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  2.066e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  3.083e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: Fil4\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  2.349e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  6.776e+02 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  4.878e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.871e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  2.768e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  3.423e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: Fil5\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  2.488e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  9.083e+02 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  4.019e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  4.373e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  2.385e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  3.822e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: Fil8\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  2.856e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.838e+02 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  3.610e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.400e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  4.426e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  4.416e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: Fil10\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  2.770e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  1.080e+03 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  4.487e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  5.561e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  1.745e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  3.359e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: G24\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  1.644e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.928e+02 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  8.733e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.702e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  1.664e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.759e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: G47\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  9.509e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  4.347e+01 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  1.491e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  9.285e+01 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  7.693e-01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  1.321e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: G49\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  1.073e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  1.637e+03 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  1.973e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  5.294e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  7.257e-01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  1.431e+02 (auto) [aplpy.rgb]\n",
      "Current RGB image: Snake\n",
      "INFO: Red: [aplpy.rgb]\n",
      "INFO: vmin =  2.314e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.399e+02 (auto) [aplpy.rgb]\n",
      "INFO: Green: [aplpy.rgb]\n",
      "INFO: vmin =  4.375e+01 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  2.175e+02 (auto) [aplpy.rgb]\n",
      "INFO: Blue: [aplpy.rgb]\n",
      "INFO: vmin =  1.784e+00 (auto) [aplpy.rgb]\n",
      "INFO: vmax =  4.318e+02 (auto) [aplpy.rgb]\n"
     ]
    }
   ],
   "source": [
    "for Name in ListNames:\n",
    "    # Reference and Output directories for the bone\n",
    "    print('Current RGB image: '+Name)\n",
    "    RefDir = 'Cubes/'\n",
    "    OutDir = 'Preview/'\n",
    "    # Creating test RGB images\n",
    "    make_rgb_image(RefDir+Name+'_RGB_cube_'+RedStr+'_'+GreenStr+'_'+BlueStr+'.fits',OutDir+Name+'_RGB_cube_'+RedStr+'_'+GreenStr+'_'+BlueStr+'.png')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "PoLiteWIP",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
